import { createRouter, createWebHistory } from "vue-router";
import Login from "../views/Login.vue";

const routes = [
  {
    path: "/login",
    component: Login
  },
  {
    path: "/home",
    component: () => import("../views/Home.vue"),
    children: [{
      path: "/home/user",
      component: () => import("../views/User.vue")
    },
      // {
      //   path: "",
      //   redirect: "/home/user"  // 重定向 当页面来到home是默认选中的子路由
      // }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes
})

export default router

